<template>
  <div>
    <button v-on:click="dothis">基本的事件绑定</button>
    <button @click="dothis(20, $event)">简写方式</button>
    <!-- <button @[eventname]="dothis">动态事件绑定</button> -->

    <a href="https://www.baidu.com/" @click.prevent="nojump">我不想跳到百度</a>
  </div>
</template>

<script>
export default {
  //定义数据 ,必须为函数,且返回一个对象

  methods: {
    dothis(e, v) {
      console.log(e, v);
    },
    nojump() {
      console.log("取消了默认跳转效果");
    },
  },
};
</script>

<style lang="less" scoped>
</style>
